clean up sorting routine