Rejiggered things to use shared_ptr everywhere - still crashes but
getting closer to the rca