realised dialog logic
gui must work