function have to be by reference as all sorting function of the core