new fast version in shared memory