reorganized bug and sequence class code