first iteration of blink detection