add average function use