updated the scanner to output to stdout