fixed endgame check, now in board class