Updated algorithm. Now it has fewer issues with head movement and unexpected blinks detected.