Changed sliding window buffer to array