Added EndGame function