Lei's end-of-game stuff