Updated eyesdetect function