made showing of the matching result optional
refactored matching method