added writing steps