Added tidy configuration document
Tidied up code.