Moved from iteritems to items

This makes the code Python 3 compatible