Sleep disorders can be primary in which there is a defect in the sleep timing mechanism (sometimes called sleep architecture) called dyssomnias and by parasomnias which includes nightmare disorder. Sleep disorders may also arise from medical conditions, another psychological problem such as anxiety and/or depression or even induced by substance (Eg. alcohol).