Added generation functionality to GUI
refactoring gui