deleting redundancy code in diff.py