added validator with simple examples and tests