switched to smart ptrs and simplified sinking