Solution of partial differential equations by a modified random walk