Roungh draft code.  Not ready to run