Added some comments. Collects hashmap correctly