update with more elaborate examples and more robust validation