some python fixes to make it run
first working version