Used MathUtils.isEqual to check for floating point equality.