f_avg added