fixed DEF to work correctly, finally, with docs from where I coded it.