Calculating the average from every example.
Merged Filip's averaging.