Frist version of code in place. Lot's of cleanup.