Wrote Validator and unit tests