Finished code, and printed results out to the console.