tidied up scripts