Use xrange everywhere
Add a simple profiling script