Made controller run on a separate thread. Made changes to accept param directly from gui.