implements map by dynamic hashing