logic for GUI and results saver