Implimented generate()