FIX: use range instead of xrange