updated scanFunctions