implemented runProgram and runScript