A useful code for sequences