For Python 3 compatibility, we'll have to use `range` instead of `xrange`. None of these seem so large as to create a memory issue in 2.x when full lists are created, instead of generators.