Fixed Code that it runs now in both directions. The current test case it fails is if we have button sequence 2 3 1 2 1 2 1 2 1 2 1 2 1... and so on. 3 will never get served