made some changes to alleviate t1 < t0 problem