Tidied up code formatting