Rewrite for syntax correctness