changed createGrid() to take two parameters, width and height of grid