minor changes, add comments