now computes average