i also tried getting rid of the 'next' dict and just keeping track of a boolean of whether we changed anything on each pass, but that made it slower somehow. cache effects i guess?