match func and unit tests updated