Updated to use VisibleLayers