change to scanner to function
update tests
Merge pull request #5 from liangji101/develop

change to scanner to function