Indexing using a free random variable

Thanks, yes it works!

But there is no way to make it work using Metropolis?