Added some formatting and comments.