implemented sequence class