replace sum_sqr_diffs with sum_abs_diffs