stalemate logic added