fixed abs(double) ambiguity error. added include for cmath at top.