complete code and add some annotate