started trying to implement sliding window reducer