Added option for extremes and inflections