Logic for timer
Some refactoring and partial game over logic