Added variables to main for keeping track of sums over variables.