Switched loop button checking to switch case