Added formula to calculate timer top value