Tidied up files, added comments and documentation

Just in case someone stumbled upon this repository and finds it helpful
:)