Made changes to make this package compatible with both Python2.7 and Python3