Tidied up source code and styles