added generators
fixed a bug in the generator