Working on weightedSum