WIP: code generation
Tests passing