Added language totals functions and to main function.