A little less haste would have helped. The final line of rnorm should read y{r1,r2 The function qnorm needs to have rank 0. A new version which avoids all of the if. statements has been developed. Fraser.