private void buildMaze()
	{
		grids = new Grid[this.width][this.height];
		ArrayList<Wall> walls = new ArrayList<Wall>();
		
		for (int x = 0; x < width; x++)
		{
			for (int y = 0; y < height; y++)
			{
				grids[x][y] = new Grid(x, y);
			}
		}
		
		// assign walls. When assigning walls, the grids at all sides of the
		// maze needs to be careful not to be connecting to anything else.
		for (int x = 0; x < width; x++)
		{
			for (int y = 0; y < height; y++)
			{
				Grid currentGrid = getGrid(x, y);
				
				if (x < width - 1)
				{
					Grid rightGrid = getGrid(x + 1, y);
					Wall wall = new Wall(currentGrid, rightGrid);
					currentGrid.addWall(wall);
					rightGrid.addWall(wall);
					
					walls.add(wall);
				}
				
				if (y < height - 1)
				{
					Grid topGrid = getGrid(x, y + 1);
					Wall wall = new Wall(currentGrid, topGrid);
					currentGrid.addWall(wall);
					topGrid.addWall(wall);
					
					walls.add(wall);
				}				
			}
		}
		
		generateMaze();
	}