update to use unique_ptr if compiling as c++11