first draft of code