scan with a while loop on args