Was God Unjust?

Genesis 19:24, 25 Why did God destroy Sodom and Gomorrah and the other cities? There are some troubling questions about this whole event. Why didn’t God do the things in Sodom that He did in Capernaum, if, as Jesus said, it would have resulted in the cities not being destroyed? And since He didn’t do those things, was God really just in what he did? What was Capernaum's sin that was so much greater than the exceeding wickedness of Sodom? What does that mean for you and me?