if you use np.min you should not have to ravel