updated examples with some utility functions