Tidied up code
Tidied up code
Added in ability to call reader from command line
Tidied up code