first commit

script has been tidied up