file comparison function