code polishing and commenting