simple scan function