sum initialized with 0