Implemented code gen and updated example