changed almostEqual comparison to boost efficiency