change xrange to range for py3 support