some code comments and formatting