I tried that first but the problem is since it mutates the chainSeq and the sliding iterator is lazy it causes problems. 
Although let me try and see if there is some way around this.