adding order by rank back in