Initial code done.  Probably doesn't work.  Now for testing and debugging.