finished first draft of code