Working on proper scan
Implemented proper scanning.