first complete version of scan that compiles
first complete version of scan that compiles