Dragon Slayer version 2: add console.log statements to debug/understand how the program runs