sort based on name or id (which causes a linking bug, which will need to be fixed