updated the layer functionality