Modifed function which print total money.

Modified function that Bevis added.