added sequence class and functions