cleaned up rankall.r