Added first draft of generotor function