implement array generator