clipping to percentiles - this version works