Initial draft of code.