lookup uncertainty by Sibel with minor tweaks by me.