the check if the layer is on can be the first so that the other checks don't need to run?