Add documentation to scanner.js