Added Code Gen Logic. WIP