now the demo works, some refactoring and python scripts