new version of communication.cpp