modified horizon function

upperLimit & lowerLimit use pretty instead of max/min