blink detection optimized
blink detection