Add array_sum and to_pdf functions