Added a python 3.4 compatible version of the script