changed dict iteritems() to items() for python3