new sorting mechanism