Reformatted indentations and added lots of comments.
Formatting and Indentation/Comments