I don't understand this code. It iterates the full entry set, but for each entry it gets the first Module in the map, but then it replaces the "module" instance reference each time, only keeping the last one, then returning that. Can you explain why?