A whodunit or whodunnit (a colloquial elision of "Who [has] done it?" or "Who did it?") is a complex, plot-driven variety of the detective story in which the puzzle regarding who committed the crime is the main focus. The reader or viewer is provided with the clues from which the identity of the perpetrator may be deduced before the story provides the revelation itself at its climax. The investigation is usually conducted by an eccentric, amateur, or semi-professional detective. This narrative development has been seen as a form of comedy in which order is restored to a threatened social calm.