Measure for Measure is a play by William Shakespeare, believed to have been written in 1603 or 1604. Originally published in the First Folio of 1623, where it was listed as a comedy, the play's first recorded performance occurred in 1604. The play's main themes include justice, "morality and mercy in Vienna," and the dichotomy between corruption and purity: "some rise by sin, and some by virtue fall." Mercy and virtue prevail, as the play does not end tragically, with virtues such as compassion and forgiveness being exercised at the end of the production. While the play focuses on justice overall, the final scene illustrates that Shakespeare intended for moral justice to temper strict civil justice: a number of the characters receive understanding and leniency, instead of the harsh punishment to which they, according to the law, could have been sentenced. Measure for Measure is often called one of Shakespeare's problem plays. It continues to be classified as a comedy, albeit a dark one, though its tone may defy those expectations.