adding total (sum of palendromes) also changed some variable names