implemented gradMin and gradMax features