added support to generate array elements