Added basic stalemate detection