*add sorting function