Reformatted the code to use less console.log functions, placing them at the end and assigning a variable inside of the if/else statements