moved to shared_ptr, memory managment better