writing before reading