added code generator for milestone 4