use fabs() for doubles