Sequencing and indexing algorithms