Fixed isLegalPosition (switched return bools) and its implementations