Debug mode added for showing sums in console