return sequence index and use for header