Change dict iteritems() to items() for Python 3 compatibility
Python3 print to print()