significantly sped up generate_redundantinfo, tests pass