Amended to link controller to java class, removed all unnecessary code