had a problem of the random numbers being generated were falling outside of their intended range.  I consolodated the two loops in to one and the problem appears to be fixed.