Pattern Matching program with files