added problem 3 with alerts and console.