groups and orders the imports; adds the copyright notices