added emit code functions/files. verfied creation of outputfiles
fixed segfault on input params