change iterkeys to keys for python 3.x