Updating diff code
Further updates
Initial V1.40 commit