Add example output file for example data
Defined a function in script to aid reusability
Supplement README with usage and add output.txt for output example.
Move valid path checking to function. Add docstring