refactored displayDiff