I just updated the code entirely, and using value instead of rank names, much easier