updated database to handle week and year totals