More specific detector dead layer code

Going to make a comment under the issues forum. This code is functional.