removed do while loop