Updated docuumentation
Pattern matcher: simplify logic slightly