Changed total to value

There were two conflicting variables "total". Changed to value.