added getting number of messages if each node sent separately
change value of s_j