implementing message passing