added average_in_percentiles subfunction
-applied to percentIL plots