Make the code compatibale with both, python2 and python3