finished rankall.R