completed rankall.R