diff by interval
some improvements