solution for hash exercise 2