Tried different tests and changed to use shared_ptr