code re arrangement