moved loop stuff into own static fxn getPercentileBin()