Zza: refactored lookups.js for clarity, based on Thomas Burleson revision