improved while loop for answers