https://github.com/joeyajames/Python/blob/ba3e6e66cc3a5a023f641c84571b8838f2e0af14/HashMap.py#L52 It is going to each hash location, checking if pairs exist and returning the 0th pairs. It needs to go to each hash location, check if pairs exist and loop over each pair and return their 0th element i.e. the keys.