added window and buffer splitting