working on type def instead of type decl