percentiles computation + code cleaning