fully implemented the match detection system in the game flow.