tried to improve with shared memory and failed