Nightmares, for most, are a haunting reality that stays well into adulthood. Most of the time you can shrug that uncomfortable feeling off, roll over, and go back to sleep, but sometimes the haunting from your dreams stay with you in wakefulness, making a return to sleep difficult.

What if you could control your dreams, and turn them into something else? Doctors and researchers at the PTSD Sleep Clinic of the Maimonides Sleep Arts and Sciences Center are doing just that.

Those with post traumatic stress disorder (PTSD) have nightmares much more regularly than others. The dreams are more intense and more vivid. Researchers are working with patients that are awake to alter the storyline of their dreams. Turn a racing car into a frolicking pony, an intense situation into a calming one, and your nightmare turns into a dream.

This technique is called dream mastery or scripting. Part of imagery rehearsal therapy, it is being used not only to treat those with PTSD but all nightmare sufferers.

Though dream mastery does not eliminate nightmares in all sufferers it does help to reduce intensity and frequency of bad dreams.

Not everyone is on board with the technique, though. Dreams have been heavily researched recently and scientists have found that dreams work to file important memories away while discarding the old ones. Opponents of dream mastery fear that the content of nightmares, though graphic and troubling, is necessary for the proper storage of memories in the brain. Particularly Jungian psychologists are anti-scripting because they fear that changing parts of the dream take away the opportunity to read what your subconscious is telling you.

Under 10% of adults reported having nightmares as often as once a week, but those who have had traumatic life experiences, like soldiers and rape victims, report having nightmares at a much higher rate, 90%. The goal is not to alter everyone’s dreams, but to allow peace in the night to those whose sleep is regularly disrupted.