made it a while loop