Exercise 39: test with hashmap