Added python2/3 compatability