finally it scans and returns