added compileCode method