controller class for gui