added scan.m