complete lookup function