fixed diff_f