porting the library to python3