Added some code-comments and regions for formatting the code.