The otherworld in Daoism consists of two entirely separate, if not actually opposite, parts: the realm of the dead, of those who have sinned in life and not found any access to the pure level of Dao; and the abode of the gods and immortals, the heavens of the perfected and sages who have attained utmost purity. Much of Daoist doctrine and ritual, as a result, deals with the contrast between these two, seeking possible ways of integration and harmonization. Each part, then, consists of numerous layers, including the ten courts of hell and thirty-six major heavens, and is inhabited by a multitude of beings, from the divine to the demonic. Reality never just takes place on one plane but is constantly intermingled on all levels. The multiple levels compare to shamanism as well as Western notions of heaven and hell.