functional GUI version