clean up style
bugfixes
bugfixes
improved logging