Added minmax utility.