wrote hashmap functions