added functionality for toggling layers on/off