re-worked the examples to be a little more DRY and take parameters