now really cleaned up. Bugfixes