Fixed attach demo, made the framework closer to the real thing.