implemented Communicator class with some tests