removed old sort function not used anymore