Been reading about the 1824 Election. John Q Adams won by House delegation. Andrew Jackson actually won the most electoral votes and won the popular vote, but did not have electoral majority.
Adams' people wanted Clays people to help Adams get elected and Clay would be Sec. of State. If Jackson won, Adams wanted to remain Sec. of State.