Cleaned up, added more comments to JS. Poking at the ranking formula.