Making program compliant to python3