Removed unused code. Tidied up whitespace a little