Major update, externalised sorting from datastructure