first working scripting version