Switched to a list of tuples instead of a dict to reduce hashing overhead.