using np.amin and np.amax instead of the built-in min and max

to avoid misbehaviour on some arrays