what are the functions of a scanner?