generate ordered arrays