sequencing events correctly