ported python script from string node