fixed bug and improved list comprehensions for hash table querying