Completed all cases for rankall.R