Safety commit;final BW mask disturb. next

I am now applying the logical or idea for distance now. wish me luck!