changed lookup function