Madeleine is revealed to be working with Caven, who comes up with a way to kill the Doctor and his friends whilst framing them for the piracy.