mega-restructure of everything.  separate update and IO ftns, Input datatype.