2D candidate, also fixed minor error in 1D