One way to deter undesirable behavior:
How Humanity is Made to Pay at Sing Sing
The mode of punishment now in Sing Sing prison is this: The authorities take a small cord and slip noose it around the thumbs of a prisoner, and then draw him up by the cord one foot from the floor, and let him hang there till he faints. They have a convict now under punishment whose keeper has hung him up in this way three times, and he (the keeper) says that he convict begs that he will not kill him. He let him hang and hour and ten minutes. I have been told that the Doctor says that if he had been left hanging five minutes longer he would have been a dead man. After being taken down the prisoner is put in a dark cell, in which planks are laid on the flags, with holes bored in them and pins driven in, which stick up about three inches. The prisoner has to stand on these pins in his stockings, or lie down upon them.
The Atlanta Constitution (Atlanta, Georgia) Jun 6, 1871