Complete rewrite of the message passing