Modify rankrall.R for validation