cleaned up the validation code and added a readme along with an example of how to use it