reorg, added some tests