add logic for stalemate