added echo command, optimized the generated code a bit