review the code and add some annotations.