Updated controller and command line application

Please merge.