Changed self.total to total