change 'classname' to a mor generic 'class'
crude implementation of matchingFunction