added in ch6_6 code - hash functions for table lookups