some real working code for lookup