using xrange in python2
using while
Merge pull request #45 from s7v7nislands/using_xrange

don't use range in python2