re-write diff.py as classes