Make scanFile a function.