added definition of 'writeResultFile' function in Matcher.java