added node counting and message passing thereof