removed main loop to userinterface