Changed the grid generation method with the built-in function mgrid.