minor changes

-documentation updates
-use ++i instead of i++ in loops