use message passing, add debug messaging