matchOptions function