divergence checking and improved comparison