working sum_zero function