public Layer getActiveLayer(ArrayList<Layer> l) {
        for (Layer layer : l) {

            if (layer.isActive()) {
                return layer;
            }

        }
        return null;
    }