update 2 : adding summarize within comment, and complete the code