update comments and variable names to be more accurate