wrote cusum algorithm following Galeano and Pena 2007; it works