Implementing minimum and maximum in v4