removed all code which isn't required for the bugfix

also moved the testcode to run.py

please do git diff HEAD~2 to see the real bugfix