Made several readability changes (GNU-ified the code) and added some
comments for own readability.