I don't get how this scam from "Paper Moon" works

It’s the scene where Mose buys the hair ribbon for Addy. It’s 15 cents. He hands the lady a $5 for $4.85 change. Then he hands her another dollar to get the $5 back, then hands her another $5 to get her to give him a $10. Somehow this nets him some money and I’m damned if I can figure out how. I’ve been sitting here shuffling singles and fivers back and forth and I’m at a loss. I thought I remembered seeing a column on this but a search for “paper moon” yields such helpful results as “Did Dracula really exist?”, “Did a flying saucer crash near Roswell, New Mexico in the 1940s? What’s with this ‘alien autopsy’ movie?” and “How do you use a bidet?” All fascinating, but not instructive as to the question at hand.

Grifter buys something for under a dollar, pays with $5

Grifter: 0-5=-5
Pigeon: 0+5=5

Pigeon takes the $5, gives back four $1s and change

Grifter: -5+4=-1
Pigeon: 5-4=1

Grifter gives the Pigeon the four $1s back, plus another $1, and asks for his $5 back.

Grifter: -1-5=-6
Pigeon: 1+5=6

Pigeon takes the 5 $1s and returns the $5

Grifter: -6+5=-1
Pigeon: 6-5=1

Grifter adds his $5 to the Pigeon’s 5 $1 and asks for $10

Grifter: -1-5=-6
Pigeon: 1

Pigeon gives the Grifter $10

Grifter: -6+10=4
Pigeon: 1+5-10=-4

This is the important part. Grifter doesn’t give Pigeon another $5, he gives her the same $5 twice, making her think it’s another $5.

The way I remember it is that, while he’s distracting her with chitchat, he uses the $5 dollar bill and the five single dollar bills (which he’d given to her and were now hers) to get the $10 dollar bill, thus making a quick profit of five bucks.