Why did tom bring things to muff potter in jail in Tom Sawyer?

Tom felt bad for Muff Potter because he had witnessed Muff being framed for murder by Injun Joe. Tom wanted to feel like he was giving back to Muff in order to cover up his guilt for keeping quiet about Injun Joe. That's all I'm going to say, since I'm assuming that you are asking a question directly from your reading homework. :)