Added extract mode. Also added some randomness to some test cases.