Implementation of twoWayComm and fix code mistakes in IPC examples