correct scoring formula, fixed endgame trigger