implementation for find_min and find_max