Added debugging comments and formatting