Added flipCounterCode