implementing scan
validate scan function
Merge pull request #40 from danieljoppi/master

Function scan