hash lookups before loops