Work out the code for restructure first, then do insertion (removal should be last).