restructured Sequence class to include a tree