Tidied up type of runScript