initial version, python code generation works already for a lot of cases