Made python scripts compatible with python 3