add comments, format the code