adding example with generator