in py3 somedict.keys() returns a nonindexable object rather than a list; get the list