LH-480 Tidied up code
* Added some comments and improved variable names