How to return correct percentiles?