changed shared_ptr to unique_ptr