recursive sum for list elements