I don't think this works you are assigning to a local reference, it should probably be `out[...] = ...` to copy into out