Editing while loop