Implemented Generator class complex