bugfixes
major refactoring and GUI change