function scan