calculate percentiles with quickselect
fixed bug where k==0
started with comm bus, now reading from static data