major code reorg because was messy - compiles only - not tested
chkpt