changed while loop and button class