finished first draft of pseudocode