Add sliding window
Add backgroud write