Add the matches subroutine for Group and Sample