further definition of scanner, added simple test code