Working brute-force ranking, pending unit tests.