use array_p wherever appropriate