Upgraded script to python3.