The Adventures of Tom Sawyer by Mark Twain is an 1876 novel about a young boy growing up along the Mississippi River. The story is set in the fictional town of St. Petersburg, inspired by Hannibal, Missouri, where Twain lived. Tom Sawyer lives with his Aunt Polly and his half-brother Sid. Tom dirties his clothes in a fight and is made to whitewash the fence the next day as punishment. He cleverly persuades his friends to trade him small treasures for the privilege of doing his work. He then trades the treasures for Sunday School tickets which one normally receives for memorizing verses, redeeming them for a Bible, much to the surprise and bewilderment of the superintendent who thought "it was simply preposterous that this boy had warehoused two thousand sheaves of Scriptural wisdom on his premises-a dozen would strain his capacity, without a doubt." Tom falls in love with Becky Thatcher, a new girl in town, and persuades her to get "engaged" by kissing him. But their romance collapses when she learns Tom has been "engaged" previously to Amy Lawrence. Shortly after Becky shuns him, he accompanies Huckleberry Finn to the graveyard at night, where they witness a trio of graverobbers, Dr. Robinson, Muff Potter and the halfbreed Injun Joe, getting into a fight. While Potter is knocked unconscious during the scuffle, Injun Joe knifes the doctor to death and later pins the blame on Potter, who is arrested and charged with murder. Tom and Huck run away to an island. While enjoying their new found freedom, the boys become aware that the community is sounding the river for their bodies. Tom sneaks back home one night to observe the commotion. After a brief moment of remorse at his loved ones' suffering, Tom is struck by the idea of appearing at his own funeral. Back in school, Tom gets himself back in Becky's favor after he nobly accepts the blame for a book she has ripped. Soon, Muff Potter's trial begins, in which Tom testifies against Injun Joe. Potter is acquitted, but Injun Joe flees the courtroom through a window. Tom then fears for his life as Injun Joe is at large and can easily find him. Summer arrives, and Tom and Huck go hunting for buried treasure in a haunted house. After venturing upstairs they hear a noise below. Peering through holes in the floor, they see Injun Joe disguised as a deaf-mute Spaniard; Injun Joe and his companion plan to bury some stolen treasure of their own. From their hiding spot, Tom and Huck wriggle with delight at the prospect of digging it up. Huck begins to shadow Injun Joe nightly, watching for an opportunity to nab the gold. Meanwhile, Tom goes on a picnic to McDougal's Cave with Becky and their classmates. In his overconfidence, Tom strays off the marked paths with Becky and they get hopelessly lost. That night, Huck sees Injun Joe and his partner making off with a box. He follows and overhears their plans to attack the Widow Douglas. By running to fetch help, Huck prevents the crime and becomes an anonymous hero. As Tom and Becky wander the extensive cave complex for the next few days, Becky gets extremely dehydrated and starved, so Tom's search for a way out gets even more determined. Tom one day accidentally encounters Injun Joe, but the boy is not seen by his nemesis. Eventually he finds a way out, and the two children are joyfully welcomed back by their community. As a preventive measure, Judge Thatcher has McDougal's Cave sealed off, but this traps Injun Joe inside. When Tom hears of the sealing several days later and directs a posse to the cave, they find the corpse of Joe just inside the sealed entrance, starved to death.