Better 'calibrated' procedure and better error checks for closest match module