rewriter!

+ made it work for KSequence