improved sortingfunction for comodity market