implemented percentile rank with histogram differences