Problem using switch case

If either of the buttons inputs is stuck HIGH the while() loops will freeze the program.