//returns the index of the newly added layer public int AddLayer(Layer l) { Layers.Add(l); return Layers.Count - 1; }