modifed example to use d_ii = 1