changed pointers to smart pointers