remove n+k pattern