weights were added, weighted_percentile + many fixes and updates and tests