added Python 3.3 support using six
removed dependence on xrange and range