code rearange