public Integer[][] paintFill(int x, int y, int color, Integer[][] grid){
    	if(grid[x][y] == color){
    		return grid;
    	}
    	else{
    		grid[x][y] = color;
    		if(x<grid.length-1){
    			paintFill(x+1, y, color, grid);
    		}
    		if(x>0){
    			paintFill(x-1, y, color, grid);
    		}
    		if(y>0){
    			paintFill(x, y-1, color, grid);
    		}
    		if(y<grid[x].length - 1){
    			paintFill(x, y+1, color, grid);
    		}
    	}
    	return grid;
    }