time update and sequence code