added arrayWithLength