support for switching layers and adding and removing layers