added ir_init return value, check for malloc, adding subclasses for cdats correctly...