adding shared memory read/write code