Implement scan() as wrapper function based on #2