Needs abs(cusum) to properly implement algorithm