implement own version of sdiff