This won't work in python 3; please use the `iteritems(dict)` syntax like the original.