add comments of three important functions