Added code for array generator