unused average function deleted