public Layer setActiveLayer(Layer l, boolean active, ArrayList<Layer> layers) {
        if (active) {
            for (Layer other : layers) {

                other.setActive(false);

            }
            l.setActive(true);
            return l;
        } else {

            layers.get(1).setActive(true);

            l.setActive(false);
            return layers.get(1);
        }
    }