added min, max, lowerBound and upperBound functions