code: def merge(self, layers):
          
          
          
          layers.sort()
          if layers[0] == 0: del layers[0]
          self.flatten(layers)
docs: Flattens the given layers on the canvas.
          
          Merges the given layers with the indices in the list
          on the bottom layer in the list.
          The other layers are discarded.