modifying reodering code