added match implementation