Simplify scan function
Merge pull request #1 from ghost237658/master

Simplify scan function