Made changes to code generator. Almost have functions working.