Some refactoring, game now stops when you lose, space to restart