How thoughts and memories can cause pain in the body