Added weightedAvg.m