needed to add using std::isnormal because cmath was conflicting with math.h