The texts and images of the "Book of the Dead" were magical as well as religious. Magic was as legitimate an activity as praying to the gods, even when the magic was aimed at controlling the gods themselves. Indeed, there was little distinction for the Ancient Egyptians between magical and religious practice. The concept of magic ("heka") was also intimately linked with the spoken and written word. The act of speaking a ritual formula was an act of creation; there is a sense in which action and speech were one and the same thing. The magical power of words extended to the written word. Hieroglyphic script was held to have been invented by the god Thoth, and the hieroglyphs themselves were powerful. Written words conveyed the full force of a spell. This was even true when the text was abbreviated or omitted, as often occurred in later "Book of the Dead" scrolls, particularly if the accompanying images were present. The Egyptians also believed that knowing the name of something gave power over it; thus, the "Book of the Dead" equips its owner with the mystical names of many of the entities he would encounter in the afterlife, giving him power over them.