importing script version from Thomas Klumpp