replace rank with degree