Added loops to add inputs to dictionary.
Added total variable.
Added format method to properly use total variable.