Added 2 percentile functions to master

Cherry picked #382 for master