new implementation with hashmap over associated objects