cleaned sorting feature. location sort not done