better version of the scan bash script