First draft of code outline. Not expected to work!