now using the boost::shared_ptr library instead of raw pointers