ADD: Scan function and tests