calcGrad and findAnchors finished.