According to CNN, Hillary Clinton had more votes than Trump (47,6% against 47,5%). But, since you have that system of electors representing each estate casting ballots, Trump wins 289 vs. 218.
I just applied that system to my country's last election and the results are catastrophic: my last elected President won by 51.34% of total votes against 48.66% of his opponent. But giving each Province (
state) a ballot equivalent to every territory population (I took the same numbers of the Deputies Chamber, which are also elected in a proportion of each Province population), and my current President would have lost 78 against 159 of his oponent
Point is, why isn't the President elected by most total votes instead of that cheap system assigning ballots to each estate? Imagine if just one person voted in California, and all the Alaska state voted... that person in California would be more valuable than the will of 710,000 Americans
