minor
added alarm to indicate end of game and some code refactoring