corrected timeline algorithm