Rearrange lines and activate ESS