Pulling the console.log out into its own function, and properly generating the requested number of output words despite varying n-gram lengths.