Inital draft of code