Playing G-d

There is a Pasuk that says that sons should not be punished for the sins of their fathers and father's should not be punished for the sins of their sons. Each person shall be responsible for his own sin. This seems to be in contradiction to another Pasuk in the book of Shmot that says that Hashem remembers the sins of the fathers to the third and fourth generation. This implies that sons are punished for their fathers sins for several generations. The answer to this contradiction is that one case speaks of the heavenly court and the other speaks of the earthly court. In the heavenly court, Hashem has His own calculations as to what true justice is. Man is not capable of understanding this. But in the earthly court, man is not supposed to do anything beyond judging what is in front of him. It can be a very dangerous situation when people think they can "play G-d." Hashem has been managing fine until now and each person needs to know his place. Shabbat Shalom