... We also then rank and search the entire ...
... would suck if, basically, you solved this with nested if-then loops. It would be really ...