updated generator.go