Add state transitions and timestamps