having trouble with the error in 2d inhomogenous case