Final better off-line version of CUSUM