The problem with the thrill of potentially being caught is: sometimes you get caught.
A man caught masturbating in the Dunedin City Library appeared in the Dunedin District Court yesterday after previously pleading guilty to doing an indecent act.
It was not the first time Robin Keith Hansen, 49, of Dunedin, had been collared on such matters.
Judge Kevin Phillips said Hansen racked up convictions during the 1990s for other lewd displays, and also for committing indecencies with animals.
On March 28 at 6.20pm, Hansen positioned himself between stacks on the ground floor of the Moray Pl library.
A security guard caught Hansen with his pants down and told him to stop.
He did, and she escorted him to an office where police were called.
Hansen had a dubious explanation about his behaviour.
''I wasn't going to go all the way,'' he said.
''I was trying to get rid of an erection that was starting to come up.''
Hansen changed his story temporarily when interviewed by Corrections before yesterday's sentencing hearing.
He claimed initially that he had simply been ''adjusting himself'', but later accepted the sexual bent to the offending.
Hansen also said he had not gone to the library with the intention of committing a lewd act.
Like others, he was there to borrow a book, he said.
Judge Phillips said there was no way of knowing the truth of that assertion and described Hansen's acts as ''intolerable''.
''The likelihood of young children coming around a shelf of books is extremely high and I think that's exactly what got you off, that risk,'' he said.
Counsel Brendan Stephenson said his client had not meant for anyone to see him playing with himself.
''The issue seems to be the sexual thrill of exposing himself in public rather than doing it in front of someone,'' Stephenson said.
Hansen, he told the court, suffered bouts of depression, although he was not engaged with a psychologist or counsellor.
The defendant had few friends or family and was isolated in the community, Stephenson said.
He urged the judge not to impose home detention because it would increase Hansen's social solitude.
Judge Phillips accepted the force of that submission, but said there were other factors he had to consider.
''You certainly need help and the public needs protection.''
Hansen was sentenced to three months home detention. Post-detention conditions meant the defendant would undertake any treatment ordered by Probation.
Libraries manager Bernie Hawke said the incident was one of two in a matter of days in March, but it had been an extended period since earlier flashpoints.
He said the library was equipped with CCTV, security staff were employed and there was a focus on the safety of staff and customers.