replace fabs with std::abs