Added some more pythonic features

range -> xrange
included a for-else statement