code rearraged