Imlemented Generator class