Added management of game over. Needs some testing