changed number of sequences variable to an arg of main functions