created a while loop