fixed and add comments