uncommented isLegalMove