functions for generating sequences 847470