ran rearrange code