fixed and updated python 3 compability to use six