file comparison and merging