4th version; meets format best practices

A considerably cleaned up version of the code, including implementing
recommended line length and formatting practices.