Make compatible with Python3

resolves #20