Merge codes from Long and Yuanyi, and add an "End Game" button on match page