implemented a compiler for begin