following tutorial, moving manager to the main instance loop