changed to console.log for output with if else statement