sort by matching degree