Improvment of diff

Hello,

This pull request is here to add dict for diff deleted/inserted/changed a better way than the previous one.
What do you think about it?