sliding rewrite