Added Percentile function
Added more tests for percentile and fixed some bugs