put weighted and unweighted functions back