Phase I: replaced range with xrange (generator vs. list)