Of course:

```
func hashMapTest() : Nat {
let eq: (Nat,Nat)->Bool = func(x,y) { x==y };
let keyHash: (Nat)->Hash.Hash = func(x) { Prim.natToWord32 x }; // type Hash is a Word32
let store = HashMap.HashMap<Nat,Nat>(8, eq, keyHash);
ignore store.set(1, 10);
ignore store.set(2, 10);
ignore store.set(3, 20);
let storedValue = store.get(2);
switch (storedValue) {
case (?value) {
return value; // returns 10
};
case (null) {
// handle not finding a value in the store, for example:
return 0; // returns 0
};
};
};
```

The 8 is the initial capacity of the HashMap, I just chose a number arbitrarily. The size of the hash table will grow when it gets close to filling up, it’s quite an expensive operation so you might want to start higher. Currently this just happens each time the ceiling is hit, in HashMap.mo in the base library files:

Internally, table growth policy is very simple, for now:

Double [the] capacity when the expected bucket list [is] beyond a certain constant.

HashMap is likely a good fit so you can stick with that, but tries can be useful in some situations, it’s worth exploring a bit on Wikipedia and the like. If you want to use one then you could try Motoko’s TrieMap, it has the same interface as HashMap so you can use it in the same way.

You can have a person entry hold multiple guilds (it could point to a list of guilds for example), it’s a bit of a larger design question, as per your other threads; some in here might have ideas on various ways to approach this?