Better endgame grouping