More or less working version.  Needs UI work