new version of wf-tp-dia using minmax