changing some things around maybe using shared_ptr some more