Better naming and document some endgame functions