So the Constitution is a "flawed document"?
Of course it is. It always has been.
But the founders were wise enough to know that direct election of presidents in any manner could lead to the election of tyrants.
Also since each state has 2 Senators and the senators were supposed to represent the interests of the individual states, the state legislatures were originally assigned the duty of electing senators.
By making the election of senators a democratic process rather than a process of election by representatives, the Senators now represent only those people who they can con or bribe into voting for them and this has dramatically increased the power of the Federal Government. The Senate is now a national office rather than a state office. Previously Senate seats were reserved for "statesmen" who would be selected to represent the state as a whole. These seats are now occupied by crooks who represent those who give them the most campaign contributions.