updated sum_arrays method with comments