Formatting and inserting comments

General formatting of code and insertion of the solution description as
comments prior to the start of the code.