Working implementation of percentiles, will need modification or maybe even duplication to make it work with all possible stats.