changed syntax while loop