added external package: 'six'
switched to six.string_types for string type checks