replaced end-time equality test with allclose