Optimized matching

this case should be handled properly (if it is possible at all -- haven't thought about it)