added GUI and TUI, fixed bug for parallel use