added some tests and fixed various things - call it a checkpoint