Put the list resort into a mathstuff function