Added array random and weightedRandom functions