new stuff in generate_backbones plus cleanup