implemented toPrimitiveArray