refactored min-check to function