Make the script compatible with python 3 as well