typographical fixes, code style updates, made examples consistent with current API