Rewrite using linear