Fix endgame function
Fix sysntax error in function declaration