Implimented the end game