Changed dict objects to ordereddict objects to ensure deterministic behaviour