Cat and mouse game (Genesis 44)

“God is punishing us for our sins.”

Why does Joseph continue to play this cat and mouse game? Is he trying to extract a confession from them for the way they treated him, and deceived their father?