bug fix : using fabs instead of abs