Unfinished. Divergence tracking code.