Another JS rearrangement