dynamic expandable array implementation