changed foo.next() to next(foo) for python3 compatibility