added documentation to scanner.py