Added Python3 compatibility