changed to boost shared pointers for all memory