Shared memory for orientation assignment -- almost working