First try of code generation, does not produce fully functional code yet