Tidied up some comments and removed some unused code.