Created by: kghopson
Added the new, condensed version of the code after resolving comments in the draft