United Airlines attracted widespread ridicule Monday after news outlets published videos of airport police violently dragging a passenger from an overbooked flight.

United needed four passengers to give up their seats but was unable to get enough volunteers to take $800 to get off the plane, Audra Bridges, a passenger who posted one video of the incident, told the Louisville Courier-Journal. Airline staff said they would select four passengers at random, but one man refused to leave his seat after he was selected, prompting the airline to call airport police, Bridges said.

United might have been able to avoid all of this by making its passengers aware of the law. Federal regulations require airlines to pay cash ― lots of it ― to people they bump from flights against their wishes. (They can also cut a check, which is nearly as good.) If bumping a passenger from a domestic flight delays that passenger by more than two hours, the airline has to pay the passenger 400 percent of the fare to the passenger’s destination or first stopover, up to a maximum of $1,350. (The infographic at the end of this post explains the few exceptions to this rule.) Here’s the relevant section of the Code of Federal Regulations:

LII

Multiple investigations, however, have found that airlines rarely pay passengers the full amount to which they’re entitled. In many cases, this is because the airlines ask for and get volunteers who are willing to accept less money, or even airline miles, for their inconvenience. Airlines are also supposed to tell passengers at risk of being bumped from overbooked flights how much money they will get if they’re involuntarily bumped, but it’s not clear how often they do that.

In this case, United offered passengers $800, but didn’t get enough volunteers. One reason might be that some of the passengers on the flight in question ― a Sunday evening nonstop from Chicago to Louisville, Kentucky ― were probably entitled to more than that. A one-way ticket from Chicago to Louisville on United next Sunday would run you about $221 ― meaning that, if bumped and delayed more than two hours, you’d be entitled to $884.

Some passengers likely paid even more to be on the flight, and would be entitled to more compensation. And surely the cost to United of offering passengers more money ― even the full $1,350 ― would have been far less than the negative PR from this episode. The logical thing to do would’ve been to offer more.

Here’s an infographic on all this. (It’s slightly outdated, because the compensation maximum has gone up to $1,350 from $1,300.)