Started adding the controler code framework to the thread, currently doesn't work, but the buggy code has been commented out to prevent compile and run errors.