implement basic function runScript()