both functions are working todo: GUI