refactored win logic to include stalemate