Added convertToSequenceIndex procedure.