r111: limit the number of ec in a window
r112: the last commit not working