total must be increased

total = total + value(ptr);