refactored so that we are now working with position ordered variant dicts