added function to obtain local total (if data is missing, it needs to start at that point)