Added advection and computation of gradient