First working generator implementation.