A mindwipe is a memory erasure procedure used in a number of fictional stories in which the subject's memories and sometimes personality are erased. Often those are replaced by new memories more useful to those who are carrying out the mindwiping. It is a more thorough form of brainwashing. It is sometimes used as an alternative to capital punishment, or to make the subject more useful to the system. The mindwipe can be performed by a hypnotic or magical ability, or by an electronic device. It is often coupled with stories where the characters have amnesia, although the latter concept includes cases that occur naturally or by accident instead of the result of a deliberate procedure.