Diyu is typically depicted as a subterranean maze with various levels and chambers, to which souls are taken after death to atone for the sins they committed when they were alive. The exact number of levels in Diyu and their associated deities differ between Buddhist and Taoist interpretations. Some speak of three to four "courts"; others mention "Ten Courts of Hell", each of which is ruled by a judge (collectively known as the Ten Yama Kings); other Chinese legends speak of the "Eighteen Levels of Hell". Each court deals with a different aspect of atonement and different punishments; most legends claim that sinners are subjected to gruesome tortures until their "deaths", after which they are restored to their original state for the torture to be repeated.