Tidied up a lot