revert: changed if statements to switch. Reverted 'Fixed endless restart bug' hardware problem not software