some minor code formatting and comments