Added udata to cmp function