Added method to check if game is over