printJson is now member of difference class
small changes for outputting JSON