Added end game functionality