1) Simplified code for blog tutorial.
2) Adjusted to style suggestions from @kevinwhinnery.