switched to shared_ptr and list