how to find the minimum value