design logic to find changes