The lock is just because we're working with a map/set, so if we copied the set to a list couldn't we iterate over that without locking?