Changed startup procedure. Added back threading.