private List<MazeCell> getNNodesNoDiagonal(MazeCell node) {
        ArrayList<MazeCell> nbrs = new ArrayList<>();
        int x = node.getX();
        int y = node.getY();
        int xmin = x;
        int xmax = x;
        int ymin = y;
        int ymax = y;

        if (x - 1 >= 0) {
            xmin = x - 1;
        }
        if (x + 1 < allCells.length) {
            xmax = x + 1;
        }
        if (y - 1 >= 0) {
            ymin = y - 1;
        }
        if (y + 1 < allCells.length) {
            ymax = y + 1;
        }

        int[] crds = {xmin, y, x, ymax, x, ymin, xmax, y};

        for (int i = 0; i < crds.length; i += 2) {
            MazeCell mc = allCells[crds[i]][crds[i + 1]];
            if (mc != null) {
                if (!mc.equals(node)) { //Not the node istelf
                    if (!nbrs.contains(mc)) {
                        nbrs.add(mc);
                    }
                }
            }
        }

        return nbrs;
    }