Performance bug fix

`range(0,16777215)` makes REAL list with 16M elements. Use `xrange()` instead