public static void generateMaze(int x, int y, long seed)
	{
		GRID_WIDTH = x;
		GRID_HEIGHT = y;

		stack = new ArrayList<Cell>();
		remainingCells = new ArrayList<Cell>();

		// Init array of cells
		maze = new Cell[x][y];

		// Reset maze and add cells to remainingcell list
		for (int i = 0; i < x; i++)
			for (int j = 0; j < y; j++)
			{
				maze[i][j] = new Cell(i, j);
				remainingCells.add((maze[i][j]));
			}

		// Starting the maze generating algorithm
		/*
		 * TODO: Explanation
		 */

		// STARTING CELL
		currentCell = maze[0][0];
		maze[currentCell.getX()][currentCell.getY()].visit();
		stack.add(maze[currentCell.getX()][currentCell.getY()]);
		remainingCells.remove(maze[currentCell.getX()][currentCell.getY()]);

		// Initiating random with given seed
		r = new Random(seed);

		while (!remainingCells.isEmpty())
		{
			if (checkForNeighbors(currentCell.getX(), currentCell.getY()).isEmpty())
			{
				stack.remove(stack.size() - 1);
				currentCell = stack.get(stack.size() - 1);
			} else
			{

				currentCell = checkForNeighbors(currentCell.getX(), currentCell.getY()).get(Math.abs(r.nextInt()) % checkForNeighbors(currentCell.getX(), currentCell.getY()).size());
				maze[currentCell.getX()][currentCell.getY()].visit();
				remainingCells.remove(currentCell);

				maze[currentCell.getX()][currentCell.getY()].removeWall(wallToRemove(currentCell.getX(), currentCell.getY(), stack.get(stack.size() - 1).getX(), stack.get(stack.size() - 1).getY()));
				maze[stack.get(stack.size() - 1).getX()][stack.get(stack.size() - 1).getY()].removeWall(wallToRemove(stack.get(stack.size() - 1).getX(), stack.get(stack.size() - 1).getY(),
						currentCell.getX(), currentCell.getY()));

				stack.add(maze[currentCell.getX()][currentCell.getY()]);
			}
		}

		if (remainingCells.isEmpty())
		{
			stack.removeAll(stack);
		}
	}