fixed scan and look logic