first implementation of both matchers