Added a total variable for print out