doing: implementation of diff