Finished reordering script and the helper structure stuff