Changed range to xrange; made comment PEP 8 compliant