changed output total functions so that they used doubles, this corrects an error