You need to multiply the data by the weight if the data is different. Divide it by the weighted sum.