Changed unique_ptr to shared_ptr, added scheduler methods. Still working on stuff, better no to touch at the moment