Finished the first pass with working code.