Working scan.py without latch