Improved code based on feedback in Issue #1.

Also, improved code alignment.