corrected left/mid sensor logic