tidied up code and files