clean up rank checking