fixed up python code so it actually runs