added an equivalent script in Python2