Scan discards the results of applying f to the subexpressions in expr. Unlike Map, Scan does not build up a new expression to return.
You can use Return to exit from Scan. Return[ret] causes the final value of Scan to be ret. If no explicit return values are specified, the final result from Scan is Null.