fix up rank calc a bit