Made small change so that script works with python 2.6