Added sampling from arrays.