Averages as a function done