Rewrote the percentiles calculatin for speed
not added the main library...