Formatted code and updated comments.