Rough draft of finalized code