Add shared_ptr codes and Test code