public int[][] left(int grid[][]) {
        score = 0;
        for (int yIndex = 0; yIndex < 4; yIndex++) {
            for (int xIndex = 3; xIndex > 0; xIndex--) {
                if (grid[yIndex][xIndex - 1] == 0) {
                    for (int a = xIndex - 1; a < 3; a++) {
                        grid[yIndex][a] = grid[yIndex][a + 1];
                    }
                    grid[yIndex][3] = 0;
                }
            }
            for (int xIndex = 0; xIndex < 3; xIndex++) {
                if (grid[yIndex][xIndex] == grid[yIndex][xIndex + 1]) {
                    score += grid[yIndex][xIndex];
                    grid[yIndex][xIndex + 1] += grid[yIndex][xIndex];
                    grid[yIndex][xIndex] = 0;
                }
            }
            for (int xIndex = 3; xIndex > 0; xIndex--) {
                if (grid[yIndex][xIndex - 1] == 0) {
                    for (int a = xIndex - 1; a < 3; a++) {
                        grid[yIndex][a] = grid[yIndex][a + 1];
                    }
                    grid[yIndex][3] = 0;
                }
            }
        }
        return grid;
    }