first draft of generator part