Peter Madsen, the Danish inventor accused of killing and dismembering 30-year-old Swedish journalist Kim Wall, admitted in court on Tuesday that he stabbed her aboard his homemade submarine. Madsen still denies that he killed her.

When the beloved journalist, whose work appeared in Vice, the New York Times, and more, didn’t return from a trip to write a story about Madsen, her partner alerted authorities and a search began. Madsen later intentionally sank his small submarine, and weeks later a headless torso was discovered floating in Koge Bay. It was identified as Wall's.

Multiple stab wounds were found on Wall's body, but Madsen still denies that he killed her. He did, however, admit to dismembering her body last year. Madsen previously claimed that Wall died when a hatchet fell on her head, but later changed his story. In court on Wednesday, according to the New York Daily News, Madsen said Wall “died in an air pressure accident aboard the submarine.” He also admitted that he dismembered her body in the submarine's bathroom, according to Sky News. 

Madsen claims the stabbing occurred post mortem, giving a bizarre explanation for the wounds. He reportedly stabbed the 30-year-old Swede in order to avoid a “buildup of gas in her body,” so that her body parts would sink. "I pierced certain parts of her body because I did not want them to be inflated by gas," he said, according to the AFP. "There was nothing erotic in those blows."

In addition to testimonies, the court has watched two videos from Madsen’s computer that feature beheadings. Prosecutors claim Madsen watched one of the videos the night before he killed Wall. Madsen is being charged for murder, sexual assault, and indecent handling of a corpse. If convicted he faces life in prison, which is typically 16 years in Denmark.