s/xrange/range

Plus an output formatting bugfix... whoops.