more coding for rankall.r