again bugfixing according to todos (rewriting)