improved array conversion