added rstrip to scanner.py