updated correlation for 3d

first draft