Tidied up scripts and added revert