Tidied up code ready to push to development