No help from me, I am afraid.
But be as specific as possible.
What Is the aim of the MC code: draw random numbers from your distribution?
Then specify the exact form of the distribution.
I saw you also posted in Cross Validated, which seems a sensible thing to do.