separate (unused) shadow detection code