modifications to allow not c++11 compile and changed almostEqual for ==