Moved var total from above function to below

Deleted console.log out of function "if, else if" statement and moved
them to below the function
Changed condition of "if" portion of statement and moved console.log comments to their new location below function
added workspace file to idea folder