adjust match function