adding the diff logic