Changed HashMaps to IdentityHashMaps