the way it works is that you vote for a delegate who says they are pledged for a certain candidate, but they are not required to vote for that candidate at the convention. they can nominate whoever they wish to.
United States