fixed average function name