Added weighted averaging function
Renamed weighted_average to "calculate_average"