made random_array() faster