fixed issue where percentile would exceed values in list