updated array provider constructor and fixed return type