modifying diff.py significantly