Basic min, max and PSM functions added