A Swedish court ruled this week that masturbating in public is OK if it’s not directed at anyone, local media report.

The ruling came after a man was charged with sexual assault for masturbating on a beach June 6 at Drevviken beach, The Local reported. The 65-year-old man removed his shorts and started masturbating close to the water.

The man was acquitted, and the ruling stated that it “may be proven that the man exposed himself and masturbated on this occasion,” but it wasn’t a crime because he wasn’t pleasuring himself towards a specific person.

“For this to be a criminal offence it’s required that the sexual molestation was directed towards one or more people. I think the court’s judgement is reasonable,” prosecutor Olof Vrethammar told a Swedish paper. “With that we can conclude that it is OK to masturbate on the beach. The act may be considered to be disorderly conduct.”

Vrethammar doesn’t plan to appeal the decision.