code: def denoise_grid(self, val, expand=1):
          updated_grid = [[self.grd.get_tile(y,x) \
                          for x in range(self.grd.grid_width)] \
                          for y in range(self.grd.grid_height)]
          for row in range(self.grd.get_grid_height() - expand):
              for col in range(self.grd.get_grid_width() - expand):
                  updated_grid[row][col] = self.grd.get_tile(row,col)
                  if self.grd.get_tile(row,col) == val:
                      for y in range(-expand, expand):
                          for x in range(-expand, expand):
                              new_x = col+x
                              new_y = row+y
                              if new_x < 0: new_x = 0
                              if new_y < 0: new_y = 0
                              if new_x > self.grd.get_grid_width() - 1: new_x = self.grd.get_grid_width() - 1
                              if new_y > self.grd.get_grid_height() - 1: new_y = self.grd.get_grid_height() - 1
                              if expand > 0: 
                                  if randint(1,expand * 2) > (expand+1):
                                      updated_grid[new_y][new_x] = val
                              else:
                                  updated_grid[new_y][new_x] = val
          self.grd.replace_grid(updated_grid)