@asmeurer when I tried this function, it showed `arg` to be an immutable Matrix, so I converted it this way. Do you think there's a better way to do it?