Tidy up code
Merge pull request #3 from halkyon/code_tidy

Tidy up code