Fixed bug
Added total.
Fixed bugs.