Start of sensing logic