numseq is a better name for the function