modify sequences and nesting