Work on rank function. Create subset dataframe, now I have to check for NAs