starting to implement proper memory management, will test smart pointers