Inital commit of working if poorly documented code.