A little refactoring and comments
Added the MatchCounter class with the CountMatches function