wrote gradient for c1 correlation